<template >
  <div class="add_con_form tl" v-loading="loading">
    <el-dialog
      :close-on-click-modal="false"
      title="小程序二维码"
      :modal-append-to-body="false"
      :visible.sync="visible"
      :show="show"
      :before-close="closeDialog"
      @close="$emit('update:show',false)"
      class="tl size_13"
      width="300px"
    >
      <el-form :model="data" :rules="dataYZ" ref="data" class="mar_top" label-width="100px">
        <img :src="wyewm_url" style="width:100%" />

        <div class="mar_bottom_15">
          <span class="sizeColor size_13 sp_style"></span>
          <!-- <el-button  :loading='$store.state.isLoading' size="medium" type="primary" @click.prevent="closeDialog('data')">确定</el-button> -->
        </div>
      </el-form>
    </el-dialog>
  </div>
</template>


<style lang="less" scoped>
</style>

<script>
export default {
  data() {
    return {
      value: "",
      wyewm_url: "",
      data: {
        id: "",
        content: ""
      },
      loading: false,
      dataYZ: {},
      visible: this.show
    };
  },
  props: {
    show: Boolean,
    editId: String,
    clickNum: Number
  },
  methods: {
    closeDialog() {
      this.visible = false;
    },
    getDetails(id) {
      var data = {};
      data["id"] = id;
      this.$api.getUser.getXcyEwm(data).then(res => {
        if (res.data.code == 200) {
          this.wyewm_url = res.data.result;
        } else {
          this.closeDialog();
          this.$fnc.alertError(res.data.code_desc, res.data.result);
        }
      });
    }
  },
  watch: {
    show() {
      this.visible = this.show;
    },
    clickNum(id) {
      this.data.id = this.editId;
      this.getDetails(this.editId);
    }
  },
  mounted() {},
  created() {}
};
</script>
